package com.woniuxy.entity;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @Author: ideaAdmin
 * TODO:
 * Date: 2022/2/10:11:26
 * Description:
 */
@Data
public class User {

    @NotEmpty(message = "不能为空")
    @Length(min = 1, max = 15)
    private String name;

    @Valid
    @NotNull(message = "不能为空")
    //标记这个引用对象 需要被校验
    private Student student;

    @Valid
    @NotNull(message = "不能为空")
    private List<Student> students;
}
